package com.cloud.yidiandao.controller;

import com.cloud.yidiandao.entity.Conpon;
import com.cloud.yidiandao.service.intf.ConponService;
import com.cloud.yidiandao.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: yidiandao
 * @description: 一点就到物流app
 * @author: yidiandao-
 * @create: 2021-01-09 20:17:58
 */
@RestController
@RequestMapping("api/conpon/")
@Api(tags = "实现Conpon各种操作")
public class ConponController{
    /*
    *注入业务逻辑层对象*/
    @Autowired
    private ConponService service;
    /*
    * 新增内容*/
    @ApiOperation(value = "实现新增",notes = "实现新增")
    @PostMapping("save.do")
    public R save(@RequestBody Conpon conpon){
       return service.save(conpon);
    }
    /*
    * 查询 所有数据*/
    @ApiOperation(value = "实现全部查询",notes = "实现全部查询")
    @GetMapping("all.do")
    public R all(){
       return service.queryAll();
    }
}